package com.zzmcc.wechat.entity;

/**
 * 消息类型

 */
public enum MsgTypes {
	TEXT("text"), 
	LOCATION("location"), 
	IMAGE("image"),
	LINK("link"),
	VOICE("voice"),
	EVENT("event"),
	VIDEO("video");
	
	private String type;
	
	MsgTypes(String type) {
		this.type = type;
	}
	
	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

    public static MsgTypes getMsgTypes(String type) {
        if (type.equals("text"))
            return TEXT;
        else if (type.equals("location"))
             return LOCATION;
        else if (type.equals("image"))
            return IMAGE;
        else if (type.equals("link"))
            return LINK;
        else if (type.equals("voice"))
            return VOICE;
        else if (type.equals("event"))
            return EVENT;
        else if (type.equals("video"))
            return VIDEO;
        else
            return TEXT;
    }

    public static void main(String[] args) {
        MsgTypes msgTypes  = MsgTypes.getMsgTypes("a");
        System.out.println(msgTypes.getType());

    }
}